﻿package edu.pku.se.chocolate.datastructure;

import edu.pku.se.chocolate.solver.ChocolateSolver;


/**
 * 目录类
 * @author Jas0n
 *
 */
public class Category {
	String name_chs;
	String name_eng;
	public boolean isShown;
	//private int new_msg_num;
	public Category(String name_chs,String name_eng,boolean isShown){
		this.name_chs = name_chs;
		this.name_eng = name_eng;
		this.isShown = isShown;
	}
	@Override
	public boolean equals(Object o) {
		if (o instanceof Category){
			return name_eng.equals(((Category)o).name_eng);
		}
		return super.equals(o);
	}
	/**
	 * 返回大类下所有的标签的提示更新数的总称
	 * @return
	 */
	public int getNewMsgNum(){
		return ChocolateSolver.getInstance().getCategoryNewMessageNumber(this);		
	}
	/**
	 * 返回大类显示时使用的名字,中文
	 * @return
	 */
	public String getDisplayName(){
		return name_chs;
	}
	/**
	 * 返回大类存储时使用的名字,英文
	 * @return
	 */
	public String getStorageName(){
		return name_eng;
	}
	/**
	 * 返回是否是"自定义类"
	 * @return
	 */
	public boolean isCustomCategory(){
		return name_eng.equals("custom");
	}
}
